<?php

namespace App\Master\DELETE;

/**
 * 提交内容
 */
class Article extends \App\Master\CheckUser {

    public function __init() {
        parent::__init();
        if ($_SESSION['user']['user_group_id'] != 1) {
            $this->error('您没有权限操作本内容');
        }
    }
    /**
     * 更新日志标题
     */
    public function action() {
        $id = $this->isG('id', '请选择删除的内容');

        $this->db('timelog')->where('timelog_id = :timelog_id')->update([
            'timelog_delete' => '1',
            'noset' => [
                'timelog_id' => $id
            ]
        ]);

        $this->success('删除成功!', '/');
    }

    /**
     * 删除评论
     */
    public function comment() {
        $id = $this->isG('id', '请选择删除的评论');
        $this->db('timelog_comment')->where('timelog_comment_id = :timelog_comment_id')->delete([
            'timelog_comment_id' => $id

        ]);

        $this->success('删除成功!');
    }


}
